package com.three.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.three.entity.SysOperLog;
import com.three.mapper.SysOperLogMapper;
import com.three.service.OperLogService;
import com.three.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OperLogServiceImpl implements OperLogService {
    @Autowired
    private SysOperLogMapper sysOperLogMapper;
    @Override
    public R getLog(Integer currentPage, Integer pageSize) {
        //开启分页功能
        PageHelper.startPage(currentPage,pageSize);
        //查询所有
        List<SysOperLog> sysOperLogs = sysOperLogMapper.selectAll();
        //封装分页数据
        PageInfo<SysOperLog> pageInfo = new PageInfo<>(sysOperLogs);
        return R.ok(pageInfo);
    }
}
